a11y: More State<>Change confusion
authorMatthias Clasen <mclasen@redhat.com>
Sun, 25 Oct 2020 03:12:36 +0000 (23:12 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 25 Oct 2020 03:12:36 +0000 (23:12 -0400)
We should really avoid this needless duplication
- the 'state' is never stored anywhere.

gtk/a11y/gtkatspiroot.c
gtk/a11y/gtkatspirootprivate.h

index 9aec9af186952cf4804969cf3b74720755c9f00a..c4c09bdae122929814e3fe76a3d61d841ae8dabf 100644 (file)
@@ -407,12 +407,13 @@ static const GDBusInterfaceVTable root_accessible_vtable = {
 
 void
 gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
-                               GtkAccessibleChildState   state,
+                               GtkAccessibleChildChange  change,
                                GtkAccessible            *child)
 {
   guint n, i;
   int idx = 0;
   GVariant *window_ref;
+  GtkAccessibleChildState state;
 
   if (!self->toplevels)
     return;
@@ -443,6 +444,18 @@ gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
       window_ref = gtk_at_spi_context_to_ref (GTK_AT_SPI_CONTEXT (context));
     }
 
+  switch (change)
+    {
+    case GTK_ACCESSIBLE_CHILD_CHANGE_ADDED:
+      state = GTK_ACCESSIBLE_CHILD_STATE_ADDED;
+      break;
+    case GTK_ACCESSIBLE_CHILD_CHANGE_REMOVED:
+      state = GTK_ACCESSIBLE_CHILD_STATE_REMOVED;
+      break;
+    default:
+      g_assert_not_reached ();
+    }
+
   gtk_at_spi_emit_children_changed (self->connection,
                                     self->root_path,
                                     state,
index c4046c35e5dad756b947b6672b2fd89af2204fc6..f5ae272999a624bef9a2c169355bc09118265d6c 100644 (file)
@@ -44,7 +44,7 @@ gtk_at_spi_root_to_ref (GtkAtSpiRoot *self);
 
 void
 gtk_at_spi_root_child_changed (GtkAtSpiRoot             *self,
-                               GtkAccessibleChildState   state,
+                               GtkAccessibleChildChange  change,
                                GtkAccessible            *child);
 
 G_END_DECLS